package com.taobao.txc.parser.b.c;

import com.a.a.a.a.a.c;
import com.a.a.a.a.c.c.w;
import com.taobao.txc.common.LoggerInit;
import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.common.TxcContext;
import com.taobao.txc.parser.b.a.f;
import com.taobao.txc.parser.struct.TxcTable;
import java.util.Iterator;
import java.util.List;

public class m
  extends a
  implements f
{
  private static final LoggerWrap i = LoggerInit.logger;
  
  public m(k paramk)
  {
    super(paramk);
  }
  
  private w m()
  {
    return (w)((k)j()).e();
  }
  
  public void a(w paramw) {}
  
  public String l()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    w localw = m();
    localStringBuilder.append(b(localw));
    c localc = localw.e();
    localStringBuilder.append(a(localc, null));
    com.a.a.a.a.b.d locald = localw.f();
    localStringBuilder.append(b(locald));
    com.a.a.a.a.b.b localb = localw.g();
    localStringBuilder.append(b(localb));
    return localStringBuilder.toString();
  }
  
  public String k()
  {
    return l();
  }
  
  public String d(com.taobao.txc.resourcemanager.b.a.d paramd)
  {
    w localw = m();
    StringBuilder localStringBuilder = new StringBuilder();
    c localc = localw.e();
    localStringBuilder.append(a(localc, null));
    com.a.a.a.a.b.d locald = localw.f();
    localStringBuilder.append(b(locald));
    com.a.a.a.a.b.b localb = localw.g();
    localStringBuilder.append(b(localb));
    if (i.c()) {
      i.debug("whereSqlAppender:" + localStringBuilder.toString());
    }
    return localStringBuilder.toString();
  }
  
  public TxcTable b(com.taobao.txc.resourcemanager.b.a.d paramd)
  {
    String str1 = com.taobao.txc.parser.hint.a.e(j().a());
    if ((str1 == null) || (str1.length() == 0)) {
      str1 = TxcContext.l();
    }
    String str2;
    if (str1 != null)
    {
      if (i.c()) {
        i.debug("rule:" + str1);
      }
      c(str1);
      str2 = a(true);
    }
    else
    {
      str2 = g();
    }
    String str3 = str2 + d(paramd) + " FOR UPDATE";
    a(a(paramd, str3));
    return c();
  }
  
  public TxcTable c(com.taobao.txc.resourcemanager.b.a.d paramd)
  {
    if (e() != null) {
      return null;
    }
    if (c().b() == 0)
    {
      b(i());
    }
    else
    {
      String str = g() + c(c());
      b(b(paramd, str));
    }
    return d();
  }
  
  String b(com.a.a.a.a.b.b paramb)
  {
    StringBuilder localStringBuilder = h();
    if (paramb != null)
    {
      localStringBuilder.append(' ');
      paramb.a(this);
    }
    return localStringBuilder.toString();
  }
  
  String b(com.a.a.a.a.b.d paramd)
  {
    StringBuilder localStringBuilder = h();
    if (paramd != null)
    {
      localStringBuilder.append(' ');
      paramd.a(this);
    }
    return localStringBuilder.toString();
  }
  
  String b(w paramw)
  {
    StringBuilder localStringBuilder = h();
    localStringBuilder.append("UPDATE ");
    if (paramw.a()) {
      localStringBuilder.append("LOW_PRIORITY ");
    }
    if (paramw.b()) {
      localStringBuilder.append("IGNORE ");
    }
    localStringBuilder.append(j().b());
    localStringBuilder.append(" SET ");
    int j = 1;
    Iterator localIterator = paramw.d().iterator();
    while (localIterator.hasNext())
    {
      com.a.a.a.c.b localb = (com.a.a.a.c.b)localIterator.next();
      if (j != 0) {
        j = 0;
      } else {
        localStringBuilder.append(", ");
      }
      ((com.a.a.a.a.a.f.d)localb.a()).a(this);
      localStringBuilder.append(" = ");
      ((c)localb.b()).a(this);
    }
    return localStringBuilder.toString();
  }
  
  String a(c paramc, String paramString)
  {
    StringBuilder localStringBuilder = h();
    if (paramc != null)
    {
      localStringBuilder.append(" WHERE ");
      paramc.a(this);
      if ((paramString != null) && (!paramString.isEmpty()))
      {
        localStringBuilder.append(" AND ");
        localStringBuilder.append(paramString);
      }
    }
    else if ((paramString != null) && (!paramString.isEmpty()))
    {
      localStringBuilder.append(" WHERE ");
      localStringBuilder.append(paramString);
    }
    return localStringBuilder.toString();
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.parser.b.c.m
 * JD-Core Version:    0.7.0.1
 */